<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\OrderGoodsBean;

class OrderGoodsValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 OrderGoodsBean::$id => 'require', //
			 OrderGoodsBean::$orderNumber => 'require|max:255', //订单号
			 OrderGoodsBean::$storeId => 'require', //
			 OrderGoodsBean::$userId => 'require', //
			 OrderGoodsBean::$type => 'require', //1洗照片，2证件照，3打印
			 OrderGoodsBean::$categoryGroupId => 'require', //组合id
			 OrderGoodsBean::$categoryGroupName => 'require|max:255', //组合名称
			 OrderGoodsBean::$categoryGroupPrice => 'require|max:255', //组合价格
			 OrderGoodsBean::$goodsCount => 'require', //商品数量
			 OrderGoodsBean::$totalPrice => 'require', //商品总价格
			 OrderGoodsBean::$realPrice => 'require', //实际支付价格
			 OrderGoodsBean::$status => 'require', //1 未支付，2支付完成
			 OrderGoodsBean::$payTime => 'require', //支付时间
			 OrderGoodsBean::$payType => 'require', //1微信支付，2余额支付
			 OrderGoodsBean::$userAddressId => 'require', //收货地址，默认0自提
			 OrderGoodsBean::$postage => 'require', //油费
			 OrderGoodsBean::$phone => 'require|max:255', //预留手机号码
			 OrderGoodsBean::$remark => 'require', //备注
			 OrderGoodsBean::$createdAt => 'require', //
			 OrderGoodsBean::$updateAt => 'require', //
		];
		$this->message = [
			OrderGoodsBean::$id.POINST."require " => 'id必须', //
			OrderGoodsBean::$orderNumber.POINST."require " => 'order_number必须', //订单号
			OrderGoodsBean::$storeId.POINST."require " => 'store_id必须', //
			OrderGoodsBean::$userId.POINST."require " => 'user_id必须', //
			OrderGoodsBean::$type.POINST."require " => 'type必须', //1洗照片，2证件照，3打印
			OrderGoodsBean::$categoryGroupId.POINST."require " => 'category_group_id必须', //组合id
			OrderGoodsBean::$categoryGroupName.POINST."require " => 'category_group_name必须', //组合名称
			OrderGoodsBean::$categoryGroupPrice.POINST."require " => 'category_group_price必须', //组合价格
			OrderGoodsBean::$goodsCount.POINST."require " => 'goods_count必须', //商品数量
			OrderGoodsBean::$totalPrice.POINST."require " => 'total_price必须', //商品总价格
			OrderGoodsBean::$realPrice.POINST."require " => 'real_price必须', //实际支付价格
			OrderGoodsBean::$status.POINST."require " => 'status必须', //1 未支付，2支付完成
			OrderGoodsBean::$payTime.POINST."require " => 'pay_time必须', //支付时间
			OrderGoodsBean::$payType.POINST."require " => 'pay_type必须', //1微信支付，2余额支付
			OrderGoodsBean::$userAddressId.POINST."require " => 'user_address_id必须', //收货地址，默认0自提
			OrderGoodsBean::$postage.POINST."require " => 'postage必须', //油费
			OrderGoodsBean::$phone.POINST."require " => 'phone必须', //预留手机号码
			OrderGoodsBean::$remark.POINST."require " => 'remark必须', //备注
			OrderGoodsBean::$createdAt.POINST."require " => 'created_at必须', //
			OrderGoodsBean::$updateAt.POINST."require " => 'update_at必须', //
		];
		$this->scene = [
			self::$all => [
				OrderGoodsBean::$id,
				OrderGoodsBean::$orderNumber,
				OrderGoodsBean::$storeId,
				OrderGoodsBean::$userId,
				OrderGoodsBean::$type,
				OrderGoodsBean::$categoryGroupId,
				OrderGoodsBean::$categoryGroupName,
				OrderGoodsBean::$categoryGroupPrice,
				OrderGoodsBean::$goodsCount,
				OrderGoodsBean::$totalPrice,
				OrderGoodsBean::$realPrice,
				OrderGoodsBean::$status,
				OrderGoodsBean::$payType,
				OrderGoodsBean::$userAddressId,
				OrderGoodsBean::$updateAt,
				OrderGoodsBean::$createdAt,
			],
			self::$add => [
				OrderGoodsBean::$storeId,
				OrderGoodsBean::$userId,
			],
			self::$edit => [
				OrderGoodsBean::$id,
				OrderGoodsBean::$orderNumber,
				OrderGoodsBean::$storeId,
				OrderGoodsBean::$userId,
				OrderGoodsBean::$type,
				OrderGoodsBean::$categoryGroupId,
				OrderGoodsBean::$categoryGroupName,
				OrderGoodsBean::$categoryGroupPrice,
				OrderGoodsBean::$goodsCount,
				OrderGoodsBean::$totalPrice,
				OrderGoodsBean::$status,
				OrderGoodsBean::$payType,
				OrderGoodsBean::$userAddressId,
			],
			self::$pkId => [],

		];
	}


}
